@extends('Admin.layout.layout')
@section('title','订单修改')
    <script type="text/javascript" charset="utf-8" src="/public/baidu/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="/public/baidu/ueditor.all.min.js"> </script>
    <!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
    <!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
    <script type="text/javascript" charset="utf-8" src="/public/baidu/lang/zh-cn/zh-cn.js"></script>

@section('content')
	<div class="row">
		<div class="col-lg-12">
			<h1 class="page-header">订单修改</h1>
		</div>
		<!-- /.col-lg-12 -->
	</div>
<div class="row">
    <div class="col-lg-12">
        <div class="panel panel-default">
            <div class="panel-heading">
                订单修改   
            </div>
             @if (count($errors) > 0)
                <div class="alert alert-danger col-lg-6 col-lg-offset-3">
                    <ul>
                        @foreach ($errors->all() as $error)
                            <li>{{ $error }}</li>
                        @endforeach
                    </ul>
                </div>
            @endif
            <div class="panel-body">
                <div class="row">
                    <div class="col-lg-6 col-lg-offset-3">
                        <form role="form" action="{{url('admin/order/save')}}" method="post" enctype="multipart/form-data">
                            <input type="hidden" name="id" value="{{$orders->id}}">
                            
                            <div class="form-group">
                                <label>订单编号</label>
                                <input class="form-control" name="dingdan_id" value="{{$orders->dingdan_id}}">
                            </div>
                            <div class="form-group">
                                <label>商品价格</label>
                                <input class="form-control" name="price" value="{{$orders->price}}">
                            </div>
                            <div class="form-group">
                                <label>收货人</label>
                                <input class="form-control" name="utname" value="{{$orders->utname}}">
                            </div>
                            <div class="form-group">
                                <label>商品图片</label>
                                <input type="file" name="pic">
                            </div>
                            <div class="form-group">
                                <label>商品尺寸</label>
                                <label class="checkbox-inline">
                                    <input type="checkbox" name="size[]" value="1" @if(1 == $orders->dingdan_size) checked="checked" @endif>S
                                </label>
                                <label class="checkbox-inline">
                                    <input type="checkbox" name="size[]" value="2" @if(2==$orders->dingdan_size) checked="checked" @endif>M
                                </label>
                                <label class="checkbox-inline">
                                    <input type="checkbox" name="size[]" value="3" @if(3==$orders->dingdan_size) checked="checked" @endif>L
                                </label>
                                <label class="checkbox-inline">
                                    <input type="checkbox" name="size[]" value="4" @if(4==$orders->dingdan_size)) checked="checked" @endif>XL
                                </label>
                                <label class="checkbox-inline">
                                    <input type="checkbox" name="size[]" value="5" @if(5==$orders->dingdan_size) checked="checked" @endif>XXL
                                </label>
                            </div>
                            <div class="form-group">
                                <label>商品颜色</label>
                                <label class="checkbox-inline">
                                    <input type="checkbox" name="color[]" value="1" @if(1==$orders->dingdan_color) checked="checked" @endif>红
                                </label>
                                <label class="checkbox-inline">
                                    <input type="checkbox" name="color[]" value="2" @if(2==$orders->dingdan_color) checked="checked" @endif>黄
                                </label>
                                <label class="checkbox-inline">
                                    <input type="checkbox" name="color[]" value="3" @if(3==$orders->dingdan_color) checked="checked" @endif>蓝
                                </label>
                                <label class="checkbox-inline">
                                    <input type="checkbox" name="color[]" value="4" @if(4==$orders->dingdan_color) checked="checked" @endif>绿
                                </label>
                                <label class="checkbox-inline">
                                    <input type="checkbox" name="color[]" value="5" @if(5==$orders->dingdan_color) checked="checked" @endif>黑
                                </label>
                                <label class="checkbox-inline">
                                    <input type="checkbox" name="color[]" value="6" @if(6==$orders->dingdan_color) checked="checked" @endif>白
                                </label>1
                                <label class="checkbox-inline">
                                    <input type="checkbox" name="color[]" value="7" @if(7==$orders->dingdan_color) checked="checked" @endif>橙
                                </label>                           
                            </div>
                            <div class="form-group">
                                <label>订单状态</label>
                                <div class="radio">
                                    <label>
                                        <input name="status" id="optionsRadios1" value="1" type="radio" @if($orders->status == 1) checked="checked" @endif>已支付
                                    </label>
                                </div>
                                <div class="radio">
                                    <label>
                                        <input name="status" id="optionsRadios2" value="2" type="radio" @if($orders->status == 2) checked="checked" @endif>未支付
                                    </label>
                                </div>
                                <div class="radio">
                                    <label>
                                        <input name="status" id="optionsRadios2" value="2" type="radio" @if($orders->status == 3) checked="checked" @endif>已取消
                                    </label>
                                </div>
                            </div>
                            
                            {{csrf_field()}}
                            <button type="submit" class="btn btn-primary col-lg-2 col-lg-offset-4">修改</button>
                            <button type="reset" class="btn btn-warning col-lg-offset-1">重置</button>
                        </form>
                    </div>
                </div>
                <!-- /.row (nested) -->
            </div>
            <!-- /.panel-body -->
        </div>
        <!-- /.panel -->
    </div>
    <!-- /.col-lg-12 -->
</div>  
<script type="text/javascript">
    //实例化编辑器
    //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
    var ue = UE.getEditor('editor',{
        toolbars: [
            ['fullscreen', 'source', 'undo', 'redo'],
            ['bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc']
        ]
    });
</script>
@endsection